import request from '@/config/axios'

export interface LabelVO {
  id: number
  name: string
  labelType: number
  employCount: number
  remark: string
  score: number
  status: number
}

// 查询标签（精简)列表
export const getSimpleLabelList = async () => {
  return await request.get({ url: '/infra/label/list-all-simple' })
}
// 查询标签分页
export const getLabelPage = async (params) => {
  return await request.get({ url: `/infra/label/page`, params })
}

// 查询标签详情
export const getLabel = async (id: number) => {
  return await request.get({ url: `/infra/label/get?id=` + id })
}

// 新增标签
export const createLabel = async (data: LabelVO) => {
  return await request.post({ url: `/infra/label/create`, data })
}

// 修改标签
export const updateLabel = async (data: LabelVO) => {
  return await request.put({ url: `/infra/label/update`, data })
}

// 删除标签
export const deleteLabel = async (id: number) => {
  return await request.delete({ url: `/infra/label/delete?id=` + id })
}

// 获取分类列表
export const getType = async () => {
  return await request.get({ url: '/infra/label/type' })
}

export const labelTree = async (code: String) => {
  return await request.get({ url: '/infra/label/list-all-simple?code=' + code })
}
